/* 全局样式 */
body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: url('/static/images/eco-background.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: -1;
}

/* 标题样式 */
.main-title {
    font-size: 5rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(45deg, 
        #2ecc71, /* 绿色 */
        #9a3aee, /* 紫色 */
        #e74c3c, /* 红色 */
        #f1c40f  /* 黄色 */
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 40px 0;
    padding: 20px;
    position: relative;
    animation: gradient 8s ease infinite, bounce 2s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.main-title::after {
    content: '';
    display: block;
    width: 180px;
    height: 4px;
    background: linear-gradient(45deg, #2ecc71, #3498db, #e74c3c, #f1c40f);
    background-size: 300% 300%;
    margin: 15px auto;
    border-radius: 2px;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.function-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px auto;
    padding: 0 15px;
    max-width: 1200px;
    flex-wrap: nowrap;
}

.function-button {
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #FFB6C1, #FFC0CB);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.function-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.function-button:hover::before {
    left: 100%;
}

.function-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3);
    background: linear-gradient(45deg, #FFC0CB, #FFB6C1);
}

.function-button.active {
    background: linear-gradient(45deg, #FF69B4, #FFB6C1);
    transform: translateY(-2px);
}

/* 标签页样式 */
.tab-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.tabs {
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 5px;
    background-color: #ddd;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.tab-button.active {
    background-color: #4CAF50;
    color: white;
}

/* 内容区域样式 */
.content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* 上传区域样式 */
.upload-section {
    margin: 20px 0;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 5px;
}

/* 预览图片样式 */
.preview-image {
    max-width: 300px;
    max-height: 300px;
    margin: 10px 0;
}

/* 结果显示样式 */
.result-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

/* 相似图片网格样式 */
.similar-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.similar-image-item {
    text-align: center;
}

.similar-image-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* 聊天界面样式 */
.chat-messages {
    height: auto;
    min-height: 600px;
    overflow-y: visible;
    padding: 20px;
    background: transparent;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    transition: transform 0.3s ease;
}

.chat-messages:hover {
    transform: scale(1.02);
}

/* 聊天消息气泡样式优化 */
.message {
    margin-bottom: 24px;
    clear: both;
    animation: fadeIn 0.3s ease;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    width: 100%; /* 确保消息容器占满宽度 */
    display: inline-block; /* 改为行内块级元素 */
}

.message-content {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.6;
    transition: all 0.3s ease;
    font-size: 14px;
    overflow: visible; /* 允许内容超出 */
    margin-bottom: 10px; /* 增加消息间距 */
}

.message-content p {
    margin: 8px 0;
}

.message-content strong {
    color: #007bff;
    font-weight: 600;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 16px 0 8px;
    color: #333;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.user-message .message-content {
    float: right;
    background: linear-gradient(135deg, #007AFF, #00C6FF);
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
    transform-origin: right bottom;
}

.assistant-message .message-content {
    float: left;
    background: linear-gradient(135deg, #ffac7b, #FFC0CB);
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.2);
    transform-origin: left bottom;
}

.assistant-message .message-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.assistant-message .message-content p:empty {
    display: none;
}

.user-message .message-content:hover,
.assistant-message .message-content:hover {
    transform: scale(1.02);
}

.sender-label {
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: 700; /* 加粗发送者名称 */
    opacity: 0.9;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    opacity: 0.8;
}

.user-message .message-time {
    float: right;
    margin-right: 15px;
}

.assistant-message .message-time {
    float: left;
    margin-left: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 输入框样式 */
.chat-input-container {
    position: relative;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

#chatInput {
    width: 100%;
    padding: 15px 60px 15px 20px;
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#chatInput:focus {
    outline: none;
    border-color: #f934a3de;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.15);
}

.send-button {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #9c1efc, #00C6FF);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
}

.send-button i {
    font-size: 20px;
}

/* 修改typing-indicator样式 */
.typing-indicator {
    background-color: #f8f9fa;
    padding: 10px 20px;
    border-radius: 18px;
    display: none;
    width: max-content;
    margin: 10px 0;
}

.typing-indicator {
    padding: 12px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: inline-block;
    margin: 10px 0;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: #fe3fd2;
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 搜索和问答样式 */
.text-search-container,
.chat-input-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-suggestions,
.chat-suggestions {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.chat-suggestions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-tag,
.chat-suggestion {
    display: inline-block;
    margin: 6px 10px 6px 0;
    padding: 8px 16px;
    background: linear-gradient(45deg, #FFB6C1, #FFC0CB);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.3);
}

.suggestion-tag:hover,
.chat-suggestion:hover,
.suggestion-tag:focus,
.chat-suggestion:focus,
.suggestion-tag:active,
.chat-suggestion:active {
    transform: translateY(-2px);
    background: linear-gradient(45deg, #FF69B4, #FFB6C1);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
    color: white;
}

/* 选中状态样式 */
.suggestion-tag.selected,
.chat-suggestion.selected {
    background: linear-gradient(45deg, #FF69B4, #FFB6C1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
}

.search-tips {
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

/* 加载动画 */
.loading-spinner,
.loading {
    display: none;
    margin: 20px auto;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载动画样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    color: #333;
    font-size: 16px;
    margin: 0;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* 新增从index.html移动过来的样式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 25px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.card-title {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 2px;
}

.card-body {
    padding: 20px;
}

.result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* 问答样式 */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.question-text {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #495057;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #3b82f6;
}

.option-btn.selected {
    background: rgba(59,130,246,0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.option-btn.correct-answer {
    background: rgba(52,168,83,0.1);
    border-color: #34a853;
    color: #34a853;
}

.result-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
}

.result-feedback .correct {
    color: #34a853;
    font-weight: 600;
}

.result-feedback .incorrect {
    color: #ea4335;
    font-weight: 600;
}

.answer-detail {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.result-modal {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-modal .score {
    font-size: 48px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 10px;
}

.result-modal .title {
    font-size: 24px;
    color: #34a853;
    margin-bottom: 20px;
}

.result-modal .stats {
    margin-bottom: 25px;
    color: #666;
}

.result-modal button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    margin: 0 10px;
}

.result-modal .close-btn {
    background: #f8f9fa;
    color: #666;
}

.result-modal .restart-btn {
    background: #3b82f6;
    color: white;
}

.result-modal button:hover {
    transform: translateY(-2px);
}

.result-modal .close-btn:hover {
    background: #e9ecef;
}

.result-modal .restart-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* 搜索结果网格布局 */
.image-grid-container {
    padding: 20px 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 0 auto;
    max-width: 1200px;
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
}

.grid-card {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.img-wrapper {
    position: relative;
    width: 100%;
    height: calc(100% - 32px);
    overflow: hidden;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-card:hover .img-wrapper img {
    transform: scale(1.05);
}

.category-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: rgba(255,255,255,0.95);
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.category-label strong {
    color: #2c3e50;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .category-labels {
        padding: 8px;
    }
}

/* 搜索框样式 */
.form-control {
    border-radius: 25px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: none;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.1);
}

/* 按钮样式 */
.btn {
    border-radius: 25px;
    padding: 10px 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #FFB6C1, #FFC0CB) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2) !important;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #FFC0CB, #FFB6C1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3) !important;
}

/* 图片预览容器 */
.preview-container {
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.preview-container:hover {
    border-color: #3498db;
    background: #f1f7fb;
}

/* 历史记录样式 */
.history-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    z-index: 10;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: #ffebee;
}

/* 知识问答样式 */
.question-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.question-text {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #495057;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #3b82f6;
}

.option-btn.selected {
    background: rgba(59,130,246,0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.option-btn.correct-answer {
    background: rgba(52,168,83,0.1);
    border-color: #34a853;
    color: #34a853;
}

.result-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
}

.result-feedback .correct {
    color: #34a853;
    font-weight: 600;
}

.result-feedback .incorrect {
    color: #ea4335;
    font-weight: 600;
}

.answer-detail {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.result-modal {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-modal .score {
    font-size: 48px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 10px;
}

.result-modal .title {
    font-size: 24px;
    color: #34a853;
    margin-bottom: 20px;
}

.result-modal .stats {
    margin-bottom: 25px;
    color: #666;
}

.result-modal button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    margin: 0 10px;
}

.result-modal .close-btn {
    background: #f8f9fa;
    color: #666;
}

.result-modal .restart-btn {
    background: #3b82f6;
    color: white;
}

.result-modal button:hover {
    transform: translateY(-2px);
}

.result-modal .close-btn:hover {
    background: #e9ecef;
}

.result-modal .restart-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* 文件上传按钮美化 */
input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

input[type="file"] + label {
    font-size: 20px;
    color: white;
    background: linear-gradient(45deg, #FFB6C1, #FFC0CB);
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

input[type="file"] + label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3);
    background: linear-gradient(45deg, #FFC0CB, #FFB6C1);
}

input[type="file"] + label i {
    margin-right: 8px;
}

/* 文件名显示区域 */
.file-name-display {
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .function-buttons {
        flex-wrap: wrap;
    }
    
    .function-button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .function-buttons {
        flex-wrap: wrap;
    }
    
    .function-button {
        flex: 0 0 calc(33.33% - 20px);
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .function-buttons {
        flex-wrap: wrap;
    }
    
    .function-button {
        flex: 0 0 100%;
        margin-bottom: 10px;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 122, 255, 0.5);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 122, 255, 0.7);
}

/* 渐变背景动画 */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* AI思考过程样式 */
.thinking-content {
    margin: 10px 0;
    padding: 12px 16px;
    background: rgba(156, 30, 252, 0.05);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    transition: all 0.5s ease;
    border-left: 3px solid #9c1efc;
    white-space: pre-wrap;
    word-wrap: break-word;
    opacity: 0;
}

.thinking-content:empty {
    display: none;
}

/* 优化回答内容的显示 */
.response-content {
    margin-top: 10px;
    transition: all 0.5s ease;
    opacity: 0;
    position: relative;
    z-index: 2;
}

.response-content.show {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.error-message {
    color: #dc3545;
    padding: 8px;
    background: #f8d7da;
    border-radius: 8px;
    margin: 8px 0;
}

/* AI聊天界面卡片样式 */
#ai-chat .card {
    height: auto;
    max-height: none; /* 移除最大高度限制 */
    overflow: visible; /* 允许内容溢出 */
}

#ai-chat .card-body {
    padding: 25px;
    height: auto;
    max-height: none; /* 移除最大高度限制 */
    overflow: visible; /* 允许内容溢出 */
    display: flex;
    flex-direction: column;
}

/* 搜索结果网格样式 */
.results-grid {
    margin-top: 20px;
}

.search-result-item {
    margin-bottom: 25px;
}

.search-result-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-img-container {
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid #f0f0f0;
}

.card-img-container img {
    transition: transform 0.3s ease;
}

.search-result-card:hover .card-img-container img {
    transform: scale(1.05);
}

.category-info {
    text-align: center;
    padding: 10px;
}

.main-category {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.detailed-category {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* 优化搜索结果卡片布局 */
.search-result-card .card-body {
    padding: 15px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,1));
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .search-result-item {
        margin-bottom: 15px;
    }
    
    .main-category {
        font-size: 1rem;
    }
    
    .detailed-category {
        font-size: 0.9rem;
    }
}

/* 结果计数样式 */
.alert-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}
